package whf.framework.mail.entity;

import java.sql.Timestamp;

import whf.framework.entity.AbstractEntity;

/**
 * @author wanghaifeng
 * @create Oct 18, 2006 10:27:02 PM
 * 
 */
public class Mail extends AbstractEntity implements IMailBO {
	private String to;

	private String cc;

	private String bcc;
	
	/**
	 * 最近发送时间
	 * @property Timestamp:lastestSendTime
	 */
	private Timestamp lastestSendTime;
	
	/**
	 * 重复发送次数
	 * @property int:sendTimes
	 */
	private int sendTimes;
	
	/**
	 * 错误情况
	 * @property String:lastestSendErrors
	 */
	private String lastestSendErrors;
	
	/**
	 * 已经发送
	 * @property boolean:hasSent
	 */
	private boolean hasSent;

	public Mail(){
		super();
	}
	
	public Mail(String to, String cc, String bcc, String subject, String body) {
		this.to = to;
		this.cc = cc;
		this.bcc = bcc;
		super.setName(subject);
		super.setRemarks(body);
	}
	
	/**
	 * @return Returns the bcc.
	 */
	public String getBcc() {
		return bcc;
	}

	/**
	 * @param bcc
	 *            The bcc to set.
	 */
	public void setBcc(String bcc) {
		this.bcc = bcc;
	}

	/**
	 * @return Returns the cc.
	 */
	public String getCc() {
		return cc;
	}

	/**
	 * @param cc
	 *            The cc to set.
	 */
	public void setCc(String cc) {
		this.cc = cc;
	}

	/**
	 * @return Returns the to.
	 */
	public String getTo() {
		return to;
	}

	/**
	 * @param to
	 *            The to to set.
	 */
	public void setTo(String to) {
		this.to = to;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see whf.framework.mail.entity.IMailBO#getBody()
	 */
	public String getBody() {
		return super.getRemarks();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see whf.framework.mail.entity.IMailBO#getSubject()
	 */
	public String getSubject() {
		return super.getName();
	}

	/**
	 * @return Returns the hasSent.
	 */
	public boolean isHasSent() {
		return hasSent;
	}

	/**
	 * @param hasSent The hasSent to set.
	 */
	public void setHasSent(boolean hasSent) {
		this.hasSent = hasSent;
	}

	/**
	 * @return Returns the lastestSendTime.
	 */
	public Timestamp getLastestSendTime() {
		return lastestSendTime;
	}

	/**
	 * @param lastestSendTime The lastestSendTime to set.
	 */
	public void setLastestSendTime(Timestamp lastestSendTime) {
		this.lastestSendTime = lastestSendTime;
	}

	/**
	 * @return Returns the lastestSendErrors.
	 */
	public String getLastestSendErrors() {
		return lastestSendErrors;
	}

	/**
	 * @param lastestSendErrors The lastestSendErrors to set.
	 */
	public void setLastestSendErrors(String lastestSendErrors) {
		this.lastestSendErrors = lastestSendErrors;
	}

	/**
	 * @return Returns the sendTimes.
	 */
	public int getSendTimes() {
		return sendTimes;
	}

	/**
	 * @param sendTimes The sendTimes to set.
	 */
	public void setSendTimes(int sendTimes) {
		this.sendTimes = sendTimes;
	}

}
